<?php

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;

/**
 * @ApiResource()
 * @ORM\Entity(repositoryClass="App\Repository\TaskVoteRepository")
 */
class TaskVote
{
    /**
     * @Groups({"vote"})
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @Groups({"vote"})
     * @ORM\ManyToOne(targetEntity="App\Entity\User")
     * @ORM\JoinColumn(nullable=false)
     */
    private $user;

    /**
     * @Groups({"vote"})
     * @ORM\ManyToOne(targetEntity="App\Entity\Task", inversedBy="vote")
     * @ORM\JoinColumn(nullable=false)
     */
    private $task;

    /**
     * @Groups({"vote"})
     * @ORM\Column(type="float")
     */
    private $price;

    /**
     * @Groups({"vote"})
     * @ORM\Column(type="float", nullable=true)
     */
    private $priceMax;

    /**
     * @Groups({"vote"})
     * @ORM\Column(type="smallint")
     */
    private $status;

    /**
     * @Groups({"vote"})
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $tips;

    /**
     * @Groups({"vote"})
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $createAt;


    public function getId(): ?int
    {
        return $this->id;
    }

    public function getUser(): ?User
    {
        return $this->user;
    }

    public function setUser(?User $user): self
    {
        $this->user = $user;

        return $this;
    }

    public function getTask(): ?Task
    {
        return $this->task;
    }

    public function setTask(?Task $task): self
    {
        $this->task = $task;

        return $this;
    }

    public function getPrice(): ?float
    {
        return $this->price;
    }

    public function setPrice(float $price): self
    {
        $this->price = $price;

        return $this;
    }

    public function getPriceMax(): ?float
    {
        return $this->priceMax;
    }

    public function setPriceMax(?float $priceMax): self
    {
        $this->priceMax = $priceMax;

        return $this;
    }

    public function getStatus(): ?int
    {
        return $this->status;
    }

    public function setStatus(int $status): self
    {
        $this->status = $status;

        return $this;
    }

    public function getTips(): ?string
    {
        return $this->tips;
    }

    public function setTips(?string $tips): self
    {
        $this->tips = $tips;

        return $this;
    }

    public function getCreateAt(): ?\DateTimeInterface
    {
        return $this->createAt;
    }

    public function setCreateAt(?\DateTimeInterface $createAt): self
    {
        $this->createAt = $createAt;

        return $this;
    }

}
